package com.ITD.service.Impl;

import com.ITD.mapper.ClassMapper;
import com.ITD.pojo.Class;
import com.ITD.service.ClassService;
import com.ITD.vo.ClassListVO;
import com.ITD.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ClassServiceImpl implements ClassService {
    @Autowired
    private ClassMapper classMapper;
    @Override
    public Result getClassList() {
        LambdaQueryWrapper<Class> lqw = new LambdaQueryWrapper<>();
        lqw.eq(Class::getGradeId,1);
        List<Class> list = classMapper.selectList(lqw);
        int total = list.size();
        ClassListVO classListVO=new ClassListVO(total,list);
        return Result.success(classListVO);
    }
}
